/* SPDX-License-Identifier: GPL-2.0 */

#ifndef __AXVU_REGS_H__
#define __AXVU_REGS_H__

#include "axvu_opt.h"

#ifndef VX_CMDQ
// rsz normal batch
typedef union eiAXVU_RSZ_ADDR_U {
	unsigned int dwval;
	struct {
		unsigned int addr : 32;
	} bits;
} AXVU_RSZ_ADDR;

typedef union eiAXVU_RSZ_IN_SIZE_U {
	unsigned int dwval;
	struct bits {
		unsigned int width : 12;
		unsigned int rvd0 : 4;
		unsigned int height : 12;
		unsigned int rvd1 : 4;
	} bits;
} AXVU_RSZ_IN_SIZE;

typedef union eiAXVU_RSZ_OUT_SIZE_U {
	unsigned int dwval;
	struct {
		unsigned int width : 12;
		unsigned int rvd0 : 4;
		unsigned int height : 12;
		unsigned int rvd1 : 4;
	} bits;
} AXVU_RSZ_OUT_SIZE;

typedef union eiAXVU_RSZ_IN_STRIDE_U {
	unsigned int dwval;
	struct {
		unsigned int stride0 : 12;
		unsigned int rvd0 : 4;
		unsigned int stride1 : 12;
		unsigned int rvd1 : 4;
	} bits;
} AXVU_RSZ_IN_STRIDE;

typedef union eiAXVU_RSZ_CONVERT_CFG_U {
	unsigned int dwval;
	struct {
		unsigned int ofstx : 6;
		unsigned int ofsty : 1;
		unsigned int rvd0 : 9;
		unsigned int infmt : 3;
		unsigned int inbw : 1;
		unsigned int outfmt : 3;
		unsigned int outbw : 1;
		unsigned int rvd1 : 5;
		unsigned int outstrideen : 1;
		unsigned int inlmt : 1;
		unsigned int tflag : 1;//for output
	} bits;
} AXVU_RSZ_CONVERT_CFG;

typedef union eiAXVU_RSZ_SCALEFAC_U {
	unsigned int dwval;
	struct {
		unsigned int fac : 32;
	} bits;
} AXVU_RSZ_SCALEFAC;

typedef union eiAXVU_RSZ_OUT_STRIDE_U {
	unsigned int dwval;
	struct {
		unsigned int stride0 : 12;
		unsigned int rvd0 : 20;
	} bits;
} AXVU_RSZ_OUT_STRIDE;

// merge
typedef union eiAXVU_MERGE_CFG_U {
	unsigned int dwval;
	struct {
		unsigned int merge_mode : 1;
		unsigned int rvd0 : 31;
	} bits;
} AXVU_MERGE_CFG;

typedef union eiAXVU_MERGE_STRIDE_U {
	unsigned int dwval;
	struct {
		unsigned int instride2nd: 12;
		unsigned int rvd0 : 4;
		unsigned int outstride : 12;
		unsigned int rvd1 : 4;
	} bits;
} AXVU_MERGE_STRIDE;

typedef union eiAXVU_HIST_ROI_START_U {
	unsigned int dwval;
	struct {
		unsigned int x : 12;
		unsigned int rvd0 : 4;
		unsigned int y : 12;
		unsigned int rvd1 : 4;
	} bits;
} AXVU_HIST_ROI_START;

typedef union eiAXVU_HIST_ROI_END_U {
	unsigned int dwval;
	struct {
		unsigned int ex : 12;
		unsigned int rvd0 : 4;
		unsigned int ey : 12;
		unsigned int rvd1 : 4;
	} bits;
} AXVU_HIST_ROI_END;

#endif
#endif
